﻿using SaveSation.Entity;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SaveSation
{
    public partial class QuestionForm : Form
    {
        public QuestionForm()
        {
            InitializeComponent();
        }
        internal static QuestionResult Show(string text, string title)
        {
            using (QuestionForm questionForm = new QuestionForm())
            {
                questionForm.lblInfo.Text = text;
                questionForm.Text = title;
                DialogResult dialogResult = questionForm.ShowDialog();
                if (dialogResult == DialogResult.OK)
                {

                    return questionForm.checkBox1.Checked ? QuestionResult.DeleteStore : QuestionResult.OK;
                }
                else
                {
                    return QuestionResult.Cancel;
                }
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
        public enum QuestionResult
        {
            OK, Cancel, DeleteStore
        }
    }
}
